package ptij.vocoder.baseModel.lp_analysis;

import ptolemy.actor.*;
import ptolemy.kernel.*;
import ptolemy.kernel.util.*;
import ptolemy.data.ObjectToken;
import ptolemy.data.type.*;

import ptij.vocoder.baseModel.*;

//////////////////////////////////////////////////////////////////////////
//// LagWindow
/**

@author Ivan Jeukens
@version v 0.1 07/08/2003
*/
public class LagWindow extends TypedAtomicActor {

    public LagWindow(CompositeEntity container, String name) throws
            IllegalActionException, NameDuplicationException {
        super(container, name);

        r_h_in = new TypedIOPort(this, "r_h_in", true, false);
        r_h_in.setTypeEquals(BaseType.OBJECT);

        r_l_in = new TypedIOPort(this, "r_l_in", true, false);
        r_l_in.setTypeEquals(BaseType.OBJECT);

        r_h = new TypedIOPort(this, "r_h", false, true);
        r_h.setTypeEquals(BaseType.OBJECT);

        r_l = new TypedIOPort(this, "r_l", false, true);
        r_l.setTypeEquals(BaseType.OBJECT);
    }

    ///////////////////////////////////////////////////////////////////
    ////                     ports and parameters                  ////

    // Input ports
    public TypedIOPort r_h_in;
    public TypedIOPort r_l_in;

    // Output Ports
    public TypedIOPort r_h;
    public TypedIOPort r_l;

    ///////////////////////////////////////////////////////////////////
    ////                         public methods                    ////

    public void fire() throws IllegalActionException {
    
        ObjectToken obj = (ObjectToken) r_h_in.get(0);
        Short [] arg1 = (Short []) obj.getValue();
        
        obj = (ObjectToken) r_l_in.get(0);
        Short [] arg2 = (Short []) obj.getValue();

        lag_window(arg1, arg2);
        
        obj = new ObjectToken(arg1);
        r_h.broadcast(obj);
        
        obj = new ObjectToken(arg2);
        r_l.broadcast(obj);
    }
    
    ///////////////////////////////////////////////////////////////////
    ////                         private methods                   ////
    
    private void lag_window(Short [] r_h, Short [] r_l) {
        
        
    }

    ///////////////////////////////////////////////////////////////////
    ////                         private variables                 ////

}

